package com.changgou.item.listener;

import com.changgou.item.service.ItemService;
import org.apache.commons.lang.StringUtils;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 老大哥在看着你
 *
 * @author ANG.YU
 * @date 2019-10-16 19:08
 */
@Component
public class CreatedPageListener {
    @Autowired
    private RabbitTemplate rabbitTemplate;
    @Autowired
    private ItemService itemService;
    @RabbitListener(queues = "changgouQueue02")
    @RabbitHandler
    public void createPage(String id) {

        System.out.println("商品id为" + id);
        itemService.staticPage(id);
    }
}
